const Sequelize = require('sequelize')
let db = require('../config/db')


let Describe = db.define('describe',{
    id:{
        type: Sequelize.INTEGER,
        primaryKey:true,
        autoIncrement: true,
        comment: "主键，自增"
    },
    uid:{
        type:Sequelize.INTEGER
    },
    deletedAt: {
        type: Sequelize.DATE,
        get() {
            return moment(this.getDataValue('deletedAt')).format('YYYY-MM-DD HH:mm:ss');
        }
    },
    createdAt: {
        type: Sequelize.DATE,
        get() {
            return moment(this.getDataValue('createdAt')).format('YYYY-MM-DD HH:mm:ss');
        }
    },
    updatedAt: {
        type: Sequelize.DATE,
        get() {
            return moment(this.getDataValue('updatedAt')).format('YYYY-MM-DD HH:mm:ss');
        }
    },
    des:{
        type:Sequelize.TEXT,
        comment:'自我介绍'
    },
    isDel:{
        type: Sequelize.INTEGER,
        defaultValue:0,
        comment:'状态，是否删除'
    }
},{
    freezeTableName:true,
    paranoid:true,
    timestamps:true
})
let describe = Describe.sync();

module.exports = Describe
